package com.gang.crm.bean;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;

import javax.imageio.stream.FileImageInputStream;

public class Customer implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer id;
	private String name;
	private String station;
	private String telephone;
	private String address;

	private Integer decidedzoneId;
	
	private boolean hasAss;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getStation() {
		return station;
	}

	public void setStation(String station) {
		this.station = station;
	}

	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	

	public Integer getDecidedzoneId() {
		return decidedzoneId;
	}

	public void setDecidedzoneId(Integer decidedzoneId) {
		this.decidedzoneId = decidedzoneId;
	}

	public boolean isHasAss() {
		return hasAss;
	}

	public void setHasAss(boolean hasAss) {
		this.hasAss = hasAss;
	}

	public static String formatUrl(String url) {
		return url.replaceAll("\\\\", "/");
	}
	
	public static void main(String[] args) {
		
		String str = "/D:/DevWorkSpace/last_mouent/bos/src/main/webapp//upload/image/20170818/323234.jpg";
		File file = new File(str);
		InputStream in = null;
		OutputStream out = null;
		try {
			in = new FileInputStream(file);
			File file2 = new File("/D:/DevWorkSpace/last_mouent/bos/src/main/webapp//upload/image/20170819/323234.jpg");
			File pFile2 = file2.getParentFile();
			if(!pFile2.exists()) {
				pFile2.mkdirs();
			}
			out = new FileOutputStream(file2);
			
			byte[] buffer = new byte[1024];
			int len = 0;
			while((len=in.read(buffer))!=-1) {
				out.write(buffer, 0, len);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}finally {
			try {
				in.close();
				out.close();
			} 
			 catch (IOException e) {
				e.printStackTrace();
			}
		}
	}

}
